(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/work/room/edit" ], {
    "0b51": function(t, e, o) {
        o.r(e);
        var n, i = o("d542"), s = o.n(i);
        for (n in i) "default" !== n && function(t) {
            o.d(e, t, function() {
                return i[t];
            });
        }(n);
        e.default = s.a;
    },
    "0ed9": function(t, e, n) {
        (function(t) {
            n("767a"), o(n("66fd"));
            var e = o(n("ea9b"));
            function o(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = n, t(e.default);
        }).call(this, n("543d").createPage);
    },
    "2d23": function(t, e, o) {
        var n = o("6136");
        o.n(n).a;
    },
    "4a8e": function(t, e, o) {
        o.d(e, "b", function() {
            return i;
        }), o.d(e, "c", function() {
            return s;
        }), o.d(e, "a", function() {
            return n;
        });
        var n = {
            wkLoginModal: function() {
                return o.e("components/wk-login-modal/index").then(o.bind(null, "978a"));
            }
        }, i = function() {
            this.$createElement;
            this._self._c;
        }, s = [];
    },
    6136: function(t, e, o) {},
    d542: function(t, n, i) {
        (function(t) {
            function e(e, t) {
                var o, n = Object.keys(e);
                return Object.getOwnPropertySymbols && (o = Object.getOwnPropertySymbols(e), t && (o = o.filter(function(t) {
                    return Object.getOwnPropertyDescriptor(e, t).enumerable;
                })), n.push.apply(n, o)), n;
            }
            Object.defineProperty(n, "__esModule", {
                value: !0
            });
            var o = {
                components: {
                    multiSelect: function() {
                        i.e("pages/work/components/multi-select").then(function() {
                            return resolve(i("b309"));
                        }.bind(null, i)).catch(i.oe);
                    }
                },
                data: function() {
                    return {
                        houseId: 0,
                        house: {},
                        house2: {},
                        roomList: [],
                        isLoading: 1,
                        tools: this.$tools,
                        cover: [],
                        fj_imgs: [],
                        tagList2: [],
                        comFurnishList2: [],
                        tag_ids: "",
                        tagNames: "",
                        comFurnishIds: "",
                        comFurnishNames: "",
                        roomTypeIndex: 1,
                        roomTypeList: []
                    };
                },
                computed: function(n) {
                    for (var t = 1; t < arguments.length; t++) {
                        var i = null != arguments[t] ? arguments[t] : {};
                        t % 2 ? e(Object(i), !0).forEach(function(t) {
                            var e, o;
                            e = n, t = i[o = t], o in e ? Object.defineProperty(e, o, {
                                value: t,
                                enumerable: !0,
                                configurable: !0,
                                writable: !0
                            }) : e[o] = t;
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(i)) : e(Object(i)).forEach(function(t) {
                            Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(i, t));
                        });
                    }
                    return n;
                }({}, (n.default = void 0, i("26cb").mapState)({
                    pid: function(t) {
                        return t.pub.pid;
                    },
                    isLogin: function(t) {
                        return t.user.isLogin;
                    },
                    basicSet: function(t) {
                        return t.init.basicSet;
                    }
                })),
                onLoad: function() {
                    var t = this.$Route.query;
                    this.houseId = t.houseId || 0, this.init(), this.tagList2 = this.tagList, this.comFurnishList2 = this.comFurnishList;
                },
                onReady: function() {},
                beforeRouteLeave: function(t, e, o) {
                    console.info("leave"), o();
                },
                methods: {
                    init: function() {
                        0 < this.houseId && this.getRoomList(), this.roomDetail();
                    },
                    getRoomList: function() {
                        var e = this;
                        e.$api("my.roomList", {
                            houseId: e.houseId
                        }).then(function(t) {
                            0 === t.errno && (e.roomList = t.data.list, e.house2 = t.data.house2);
                        });
                    },
                    roomDetail: function() {
                        var o = this;
                        this.$api("my.roomDetail", {
                            houseId: o.houseId
                        }).then(function(t) {
                            var e;
                            0 == t.errno && (e = t.data.house, o.house = e, o.tagList2 = t.data.tagList, o.comFurnishList2 = t.data.comFurnishList, 
                            o.roomTypeList = t.data.roomTypeList, 0 < o.houseId && (o.tag_ids = e.tag_ids, o.tagNames = e.tagNames, 
                            o.comFurnishIds = e.common_furnish, o.comFurnishNames = e.comFurnishNames, o.cover = e.cover, 
                            o.fj_imgs = e.fj_imgs), setTimeout(function() {
                                o.roomTypeIndex = t.data.roomTypeIndex;
                            }, 300));
                        });
                    },
                    navtoBasic: function() {
                        this.$Router.push({
                            path: "/pages/work/pub/edit-step-2",
                            query: {
                                houseId: this.house2.id
                            }
                        });
                    },
                    selectRoom: function(t) {
                        t != this.houseId && (this.houseId = t, this.roomDetail());
                    },
                    openTag: function() {
                        this.$refs.multiSelect.showPicker();
                    },
                    openComFurnish: function() {
                        this.$refs.multiSelect2.showPicker();
                    },
                    tagConfirm: function(t) {
                        this.tag_ids = t.ids, this.tagNames = t.names, this.tagList2 = t.list;
                    },
                    comFurnishConfirm: function(t) {
                        this.comFurnishIds = t.ids, this.comFurnishNames = t.names, this.comFurnishList2 = t.list;
                    },
                    onChooseImg: function(e, t) {
                        var o = this;
                        o.$tools.chooseImage(t).then(function(t) {
                            t.forEach(function(t) {
                                o.$tools.uploadFile("file.upload", t).then(function(t) {
                                    e.push(t.url);
                                });
                            });
                        });
                    },
                    delImg: function(e, o) {
                        t.showModal({
                            title: "删除照片",
                            content: "确定要删除这张照片么？",
                            cancelText: "取消",
                            confirmText: "删除",
                            success: function(t) {
                                t.confirm && e.splice(o, 1);
                            }
                        });
                    },
                    typeChange: function(t) {
                        this.roomTypeIndex = t.detail.value;
                    },
                    formSubmit: function(t) {
                        var e, o, n, i = this;
                        1 != this.house.check_status ? (e = t.detail.value.rent) ? (o = t.detail.value.mian_ji) ? (n = t.detail.value.room_code) ? 0 != this.cover.length ? (t = {
                            pid: i.pid,
                            houseId: i.houseId,
                            rent: e,
                            roomCode: n,
                            mian_ji: o,
                            cover: this.cover[0],
                            tag_ids: this.tag_ids,
                            tagNames: this.tagNames,
                            comFurnishIds: this.comFurnishIds,
                            fj_imgs: JSON.stringify(this.fj_imgs),
                            guarantee: t.detail.value.guarantee,
                            content: t.detail.value.content,
                            roomType: this.roomTypeList[this.roomTypeIndex].name
                        }, i.$api("lethouse.roomPub", t, "post").then(function(t) {
                            0 == t.errno && (i.$tools.toast("发布成功"), setTimeout(function() {
                                i.$Router.back(1);
                            }, 500));
                        })) : i.$tools.toast("请上传封面图片") : i.$tools.toast("请填写房间编号") : i.$tools.toast("请填写面积") : i.$tools.toast("请填写租金") : i.$tools.toast("正在审核，请勿重复提交");
                    }
                }
            };
            n.default = o;
        }).call(this, i("543d").default);
    },
    ea9b: function(t, e, o) {
        o.r(e);
        var n, i = o("4a8e"), s = o("0b51");
        for (n in s) "default" !== n && function(t) {
            o.d(e, t, function() {
                return s[t];
            });
        }(n);
        o("2d23");
        var r = o("f0c5"), i = Object(r.a)(s.default, i.b, i.c, !1, null, null, null, !1, i.a, void 0);
        e.default = i.exports;
    }
}, [ [ "0ed9", "common/runtime", "common/vendor" ] ] ]);